package com.tjcd.project.library_base.room.bean;

import androidx.annotation.Keep;
import androidx.annotation.NonNull;
import androidx.room.ColumnInfo;
import androidx.room.Entity;
import androidx.room.PrimaryKey;

import java.io.Serializable;

/**
 * @Author jiangKunKun
 * @CreateDate 2021/11/23
 * @Description
 * @SpittingGrooves
 */
@Keep
@Entity(tableName = "user_data")
public class UserBean implements Serializable {
    public static final String USER_TABLE_NAME = "user_data" ;

    /**
     * 主键 id
     */
    @PrimaryKey(autoGenerate = true)
    public long id;

    /**
     * 用户 id
     */
    @NonNull
    public String userId;

    /**
     * 用户姓名
     */
    @NonNull
    public String name;

    // 在自动迁移中，字段的新增需要设置 defaultValue，否则会报错：
    @ColumnInfo(defaultValue = "0")
    public int age;

//    /**
//     * 巡检时间 2022-03-21 19:56:12
//     */
//    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
//    private Date InspectionTime;


    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    @NonNull
    public String getUserId() {
        return userId;
    }

    public void setUserId(@NonNull String userId) {
        this.userId = userId;
    }

    @NonNull
    public String getName() {
        return name;
    }

    public void setName(@NonNull String name) {
        this.name = name;
    }
}
